<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>考勤管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#btnExport").click(function(){
				top.$.jBox.confirm("确认要导出考勤数据吗？","系统提示",function(v,h,f){
					if(v=="ok"){
						$("#searchForm").attr("action","${ctx}/de/attendanceDe/export");
						$("#searchForm").submit();
					}
				},{buttonsFocus:1});
				top.$('.jbox-body .jbox-icon').css('top','55px');
			});
		});
		function page(n,s){       	
        	if(n) $("#pageNo").val(n);
			if(s) $("#pageSize").val(s);
			$("#searchForm").attr("action","${ctx}/de/attendanceDe/list");
			$("#searchForm").submit();
	    	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
	   <!--  
		<li class="active">考勤列表</li>
		-->
		<shiro:hasPermission name="de:attendanceDe:edit"><li><a href="${ctx}/de/attendanceDe/form">考勤添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="attendanceDe" action="${ctx}/de/attendanceDe/list" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();"/>
		<ul class="ul-form">
			<li><label>employee_id：</label>
				<form:input path="employeeId" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>name：</label>
				<form:input path="name" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li><label>abteilung：</label>
				<form:input path="abteilung" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li>
				<label>日期范围：&nbsp;</label><input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
					value="<fmt:formatDate value="${attendanceDe.beginDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
				&nbsp;--&nbsp;<input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
					value="<fmt:formatDate value="${attendanceDe.endDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>&nbsp;&nbsp;
			</li>
			
			<li class="btns">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="return page();"/>
			<input id="btnExport" class="btn btn-primary" type="button" value="导出"/>
			</li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>head_datum</th>
				<th>employee_id</th>
				<th>name</th>
				<th>dienstplan</th>
				<th>abteilung</th>
				<th>datum</th>
				<th>tag</th>
				<th>stunden</th>
				<th>cumm</th>
				<shiro:hasPermission name="de:attendanceDe:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="attendanceDe">
			<tr>
				<td>
					${attendanceDe.headDatum}
				</td>
				<td>
					${attendanceDe.employeeId}
				</td>
				<td>
					${attendanceDe.name}
				</td>
				<td>
					${attendanceDe.dienstplan}
				</td>
				<td>
					${attendanceDe.abteilung}
				</td>
				<td>	
					<fmt:formatDate value="${attendanceDe.datum}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					${attendanceDe.tag}
				</td>
				<td>
					${attendanceDe.stunden}
				</td>
				<td>
					${attendanceDe.cumm}
				</td>
				<shiro:hasPermission name="de:attendanceDe:edit"><td>
    				<a href="${ctx}/de/attendanceDe/form?id=${attendanceDe.id}">修改</a>
					<a href="${ctx}/de/attendanceDe/delete?id=${attendanceDe.id}" onclick="return confirmx('确认要删除该考勤吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>